import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';
import axios from 'axios';

const { adminPath,urlPrefix } = useGlobSetting();

export interface SafeVideo extends BasicModel<SafeVideo> {
  addTime?: string; //添加时间
  code?: string; //设备编码
  enterpriseId?: string; //主体id
  enterpriseName?: string; //主体名称
  ip?: string; //设备ip地址
  name?: string; //设备名称
  regionId?: string; //所属区域id
  rggionName?: string; //所属区域名称
  remarks?: string; //备注
  state?: string; //设备状态
  tid?: string; //设备唯一id
  type?: string; //设备类型
  warningTime?: string; //给支队预警时间
}


export const DeviceInfoData = (params) => {
    const config = {
        headers: {
            'Content-Type': 'application/json'
        }
    };
    return axios.post(urlPrefix + adminPath + '/security_alarm/deviceInfo/listData', params, config)
       .then(response => response.data)
       .catch(error => {
            console.error('请求出错:', error);
            throw error;
        });
};  

export const DeviceInfoDataDelete = (params) => {
  return axios.post(urlPrefix+adminPath + '/service/security_alarm/deviceInfo/delete', params)
    .then(response => response.data)
    .catch(error => {
      console.error('设备删除成功:', error);
      throw error;
    });
};

export const DeviceInfoDataSave = (params) => {
  return axios.post(urlPrefix+adminPath + '/service/security_alarm/deviceInfo/save', params)
    .then(response => response.data)
    .catch(error => {
      console.error('设备保存成功:', error);
      throw error;
    });
};

